import request from '@/utils/request'

// 查询患者住院信息列表 (分页)
export function selectPagePatVisit(query) {
    return request({
        url: '/business/patVisit/selectPage',
        method: 'get',
        params: query
    })
}

// 在院患者信息 (分页)
export function inHospitalPatientList(query) {
    return request({
        url: '/business/patVisit/inHospitalPatientList',
        method: 'get',
        params: query
    })
}

// 出院患者信息 (分页)
export function leaveHospitalPatientList(query) {
    return request({
        url: '/business/patVisit/leaveHospitalPatientList',
        method: 'get',
        params: query
    })
}

// 查询患者住院信息列表 (不分页)
export function listPatVisit(query) {
    return request({
        url: '/business/patVisit/list',
        method: 'get',
        params: query
    })
}

// 床头卡数据查询 (不分页)
export function bedCardList(query) {
    return request({
        url: '/business/patVisit/bedCardList',
        method: 'get',
        params: query
    })
}

// 查询患者住院信息详细
export function getPatVisit(visitId) {
    return request({
        url: '/business/patVisit/' + visitId,
        method: 'get'
    })
}

// his自费取消入院登记
export function cancelRegistration(visitId) {
    return request({
        url: '/business/patVisit/cancelRegistration/' + visitId,
        method: 'get'
    })
}
// his自费重新入院登记
export function anewRegistration(visitId) {
    return request({
        url: '/business/patVisit/anewRegistration/' + visitId,
        method: 'get'
    })
}

// 新增患者住院信息
export function addPatVisit(data) {
    return request({
        url: '/business/patVisit',
        method: 'post',
        data: data
    })
}

// 修改患者住院信息
export function updatePatVisit(data) {
    return request({
        url: '/business/patVisit',
        method: 'put',
        data: data
    })
}

// 删除患者住院信息
export function delPatVisit(visitId) {
    return request({
        url: '/business/patVisit/' + visitId,
        method: 'delete'
    })
}

export function listBedRecAndPatientDoctor (query) {
    return request({
        url: '/business/patVisit/listBedRecAndPatientDoctor',
        method: 'get',
        params: query
    })
}

// 住院医生修改患者住院信息
export function doctorUpdatePatVisit(data) {
    return request({
        url: '/business/patVisit/doctorUpdatePatVisit',
        method: 'put',
        data: data
    })
}
